package com.hz.user.interfaces.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hz.base.beans.vo.CommonResult;
import com.hz.base.beans.vo.PageEntity;
import com.hz.base.beans.vo.QueryParams;
import com.hz.beans.code.HzOperateCode;
import com.hz.beans.user.entity.BaseUserSite;
import com.hz.common.beans.constant.DemoResult;
import com.hz.interfaces.user.inf.IBaseUserSiteInterface;
import com.hz.user.service.inf.IBaseUserSiteService;

/**
 * IBaseUserSiteService
 * @author liul
 * @since [0.0.1]
 * @version [0.0.1,2018年09月11日]
 */
@Service("baseUserSiteInterface")
public class BaseUserSiteInterface implements IBaseUserSiteInterface{
	
	@Autowired
	private IBaseUserSiteService baseUserSiteService;
	

	@Override
	public CommonResult<BaseUserSite> addBaseUserSite(BaseUserSite baseUserSite) {
		CommonResult<BaseUserSite> cr = new DemoResult<>();
		cr = baseUserSiteService.insert(cr, baseUserSite);
		cr.setOperate(HzOperateCode.ADD_BASEUSERSITE);
		return cr;
	}
	
	@Override
	public CommonResult<PageEntity> queryForPage(QueryParams<BaseUserSite> queryParams) {
		CommonResult<PageEntity> cr = new DemoResult<>();
		cr = baseUserSiteService.queryForPage(cr, queryParams);
		cr.setOperate(HzOperateCode.QUERY_BASEUSERSITE_PAGE);
		return cr;
	}

	@Override
	public CommonResult<List<BaseUserSite>> queryBaseUserSiteList(QueryParams<BaseUserSite> queryParams) {
		CommonResult<List<BaseUserSite>> cr = new DemoResult<>();
		cr = baseUserSiteService.queryForList(cr, queryParams);
		cr.setOperate(HzOperateCode.QUERY_BASEUSERSITE_LIST);
		return cr;
	}

	@Override
	public CommonResult<BaseUserSite> insertSelective(BaseUserSite baseUserSite) {
		CommonResult<BaseUserSite> cr = new DemoResult<>();
		cr = baseUserSiteService.insertSelective(cr, baseUserSite);
		cr.setOperate(HzOperateCode.INSERTSELECTIVE_BASEUSERSITE);
		return cr;
	}

}
